import 'dart:core';
import 'package:dk_flutter_base/dk_ui.dart';
import 'package:dk_flutter_module_sale/sale/sale_in/following_record/bean/record_config_bean.dart';
import 'package:flutter/material.dart';
import '../../../../r.dart';

typedef SingleChoiceCallback = void Function();

// ignore: must_be_immutable

class RecordSelectTimeWidget extends StatelessWidget {

  final SingleChoiceCallback singleChoiceCallback;
  final String  content;
  final ConfigBean configBean;
  RecordSelectTimeWidget({this.configBean,this.content,this.singleChoiceCallback});
  @override
  Widget build(BuildContext context) {
    return buildRecordSelectTimeWidget(context);
  }

  Widget buildRecordSelectTimeWidget(BuildContext context) {
    return Container(
      color: Colors.white,
      child: InkWell(
        child: Column(
          children: <Widget>[
            Container(
              height: 48,
              padding: EdgeInsets.only(left: 16,right: 16),
              child: Row(
                mainAxisAlignment: MainAxisAlignment.start,
                children: <Widget>[
                  Text(configBean.title,style: TextStyle(
                    color: Color(0xff666666),
                    fontSize: 14,
                  ),),
                  Spacer(),
                  Text(content.length > 0 ? content : configBean.placeholder,
                    textAlign: TextAlign.right,
                    style: TextStyle(color:content.length > 0 ? Color(0xff333333): Color(0xff999999),fontSize: 14,fontWeight: FontWeight.normal),
                  ),
                  SizedBox(width: 3,),
                  Image.asset(R.imagesCommonRightArrowPng, width: 11, height: 11, fit: BoxFit.contain,),
                ],
              ),
            ),
            Container(
              height: 10,
              color: Color(0xffF7F8F9),
            ),

          ],
        ),
        onTap: (){
          if(singleChoiceCallback!= null) {
            singleChoiceCallback();
          }
        },
      )
    );
  }
}



